package com.dxg.msns.music.mapper;

import com.dxg.msns.music.pojo.PlaylistGrade;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.BaseMapper;

@org.apache.ibatis.annotations.Mapper
public interface PlaylistGradeMapper extends BaseMapper<PlaylistGrade> {
    // 查找用户是否已经对该歌单评分
    @Select("SELECT * FROM playlist_grade WHERE playlist_id = #{playlistId} AND user_id = #{userId} AND status = 0 LIMIT 1")
    PlaylistGrade findByPlaylistIdAndUserId(@Param("playlistId") String playlistId, @Param("userId") String userId);
}
